<?php
$content = file_get_contents('php://input');
$post    = json_decode($content, true);
$text  = $post['text'];

include 'class.ToWXML.php';
$args = array(
    'type' => $post['type'],
    'highlight' => $post['highlight'],
    'linenums' => $post['linenums'],
    'imghost' => $post['imghost'],
    'encode' => false,
    'highlight_languages' => array( 'html', 'js', 'php', 'css' )
);
//echo $text;
//echo $args;

$towxml = new ToWXML();
$json = $towxml->towxml( $text, $args);
echo json_encode( $json, JSON_UNESCAPED_UNICODE );
?>
